Stefan Merten [Tue, 3 Jan 2017 22:15:13 +0000 (23:15 +0100)]
Lots of refactorings and a few minor improvements.
User visible improvements and changes:
* Improve and debug `rst-forward-section` and `rst-backward-section`.
* Auto-enumeration may be used with all styles for list insertion.
* Improve and debug `rst-toc-insert`.
* Adapt change in Emacs to use customization group `text` instead of `wp`.
* Bind `n` and `p` in `rst-toc-mode`.
* `z` in `toc-mode` returns to the previous window configuration.
* Require Emacs version >= 24.1.
Lots of refactorings including:
* Silence byte compiler.
* Use lexical binding.
* Use `cl-lib`.
* Add tests and raise test coverage.
Stefan Monnier [Tue, 3 Jan 2017 21:07:44 +0000 (16:07 -0500)]
(cl-defstruct): Improve error message for slots w/o value (bug#25312)
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Don't signal an error but
emit a warning for those coders who forgot to put a default value in
their slot.
Philipp Stephani [Tue, 3 Jan 2017 16:24:23 +0000 (16:24 +0000)]
Small patch for ffap.el
* lisp/ffap.el (ffap-alist): Document that ffap sets the match data
while walking 'ffap-alist'.
Eli Zaretskii [Tue, 3 Jan 2017 15:46:40 +0000 (17:46 +0200)]
Generate nt/gnulib.mk from lib/gnulib.mk
This was proposed by Paul Eggert <eggert@cs.ucla.edu>,
with the purpose of avoiding manual maintenance of
nt/gnulib.mk.
* nt/gnulib-modules-to-delete.cfg: New file.
* nt/Makefile.in (AM_V_GEN, am__v_GEN_, am__v_GEN_0)
(am__v_GEN_1): New variables.
(${srcdir}/gnulib.mk): Rules to generate gnulib.mk from
lib/gnulib.mk and list of modules in gnulib-modules-to-delete.cfg.
* make-dist (nt): Add gnulib-modules-to-delete.cfg to the list of
files to link.
* configure.ac (GNULIB_MK): Compute the value according to $opsys.
* autogen.sh: Create nt/gnulib.mk if it doesn't exist, before
running autoreconf.
* Makefile.in (gnulib_mk): New variable.
($(srcdir)/nt/gnulib.mk): Rule to produce it.
(AUTOMAKE_INPUTS): Use $(gnulib_mk) instead of a literal file
name.
* .gitignore: Add nt/gnulib.mk.
* src/w32.c (acl_errno_valid): Implement it here, as we no longer
build the acl-permissions module from Gnulib.
Noam Postavsky [Thu, 29 Dec 2016 01:13:20 +0000 (20:13 -0500)]
Handle multibyte chars spanning chunks in term.el
* lisp/term.el (term-terminal-undecoded-bytes): New variable.
(term-mode): Make it buffer local. Don't make `term-terminal-parameter'
buffer-local twice.
(term-emulate-terminal): Check for bytes of incompletely decoded
characters, and save them until the next call when they can be fully
decoded (Bug#25288).
Michael Albinus [Tue, 3 Jan 2017 08:50:41 +0000 (09:50 +0100)]
Finish work on filenotify-tests.el
* test/lisp/filenotify-tests.el (file-notify--test-monitors):
New variable.
(file-notify--test-cleanup, file-notify--test-monitor): Use it.
(file-notify--test-read-event, file-notify-test02-events)
(file-notify-test04-file-validity): Handle "gvfs-monitor-dir.exe".
(file-notify-test03-autorevert)
(file-notify-test08-watched-file-in-watched-dir):
Set `file-notify--test-desc' for proper work of
`file-notify--test-monitor'. (Bug#21804)
Michael Albinus [Mon, 2 Jan 2017 18:30:21 +0000 (19:30 +0100)]
Check also for "gvfs-monitor-dir.exe" in Tramp
* lisp/net/tramp-sh.el (tramp-get-remote-gvfs-monitor-dir): Check also
for "gvfs-monitor-dir.exe".
Eli Zaretskii [Mon, 2 Jan 2017 16:55:27 +0000 (18:55 +0200)]
Fix compilation --without-x
* src/composite.c (autocmp_chars) [HAVE_WINDOW_SYSTEM]: Call
font_range only if it is compiled in. (Bug#25334)
Sašo Živanović [Fri, 30 Dec 2016 10:12:42 +0000 (11:12 +0100)]
Fix RefTeX to show table of contents for dtx files (tiny change)
* lisp/textmodes/reftex.el (reftex-compile-variables): Change the
section regexp so that it accepts lines starting with the comment
character. (tiny change)
* lisp/textmodes/reftex-parse.el (reftex-parse-from-file): Filter
gathered toc entries, accepting a commented entry if and only if the
source file is a ".dtx" file. (tiny change)
Paul Eggert [Mon, 2 Jan 2017 04:23:38 +0000 (20:23 -0800)]
Remove mistakenly-added files
Problem reported by Glenn Morris in:
http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00008.html
* lisp/gnus/gnus-ems.el, lisp/gnus/gnus-sync.el:
* lisp/gnus/messcompat.el, lisp/nxml/nxml-glyph.el:
* lisp/nxml/nxml-uchnm.el, lisp/obsolete/awk-mode.el:
* lisp/obsolete/iso-acc.el, lisp/obsolete/iso-insert.el:
* lisp/obsolete/iso-swed.el, lisp/obsolete/resume.el:
* lisp/obsolete/scribe.el, lisp/obsolete/spell.el:
* lisp/obsolete/swedish.el, lisp/obsolete/sym-comp.el:
Remove files that were added by mistake during a merge.
Noam Postavsky [Sat, 17 Dec 2016 23:01:52 +0000 (18:01 -0500)]
Warn about incomplete untarring of link files
The current tar-mode doesn't really support unpacking symlinks, it
simply creates an empty file of the same name.
* lisp/tar-mode.el (tar--describe-as-link): New function extracted from
`tar--check-descriptor'.
(tar-untar-buffer): Use it to warn about imperfectly untarred link
files.
Noam Postavsky [Tue, 20 Dec 2016 01:16:50 +0000 (20:16 -0500)]
Remove sh-mode's skeleton-end-hook
* lisp/progmodes/sh-script.el (sh-mode): Remove local setting of
`skeleton-end-hook', `skeleton-insert' already does `newline-and-indent'
and also respects `skeleton-end-newline' (Bug#16634).
Paul Eggert [Sun, 1 Jan 2017 18:54:28 +0000 (10:54 -0800)]
* nt/gnulib.mk (stdint.h): Update to match lib/gnulib.mk here.
Mark Oteiza [Sun, 1 Jan 2017 16:50:59 +0000 (11:50 -0500)]
Add term/tmux.el
Since tmux version 2.1, new tmux terminfos are shipped due to oddities
with xterm and screen terminfos. This is simply a duplication of
term/screen.el with screen -> tmux.
* lisp/term/tmux.el: New file.
Philipp Stephani [Mon, 24 Oct 2016 19:54:51 +0000 (21:54 +0200)]
Fix encoding of JSON surrogate pairs
JSON requires that such pairs be treated as UTF-16 surrogate pairs, not
individual code points; cf. Bug #24784.
* lisp/json.el (json-read-escaped-char): Fix decoding of surrogate
pairs.
(json--decode-utf-16-surrogates): New defun.
* test/lisp/json-tests.el (test-json-read-string): Add test for
surrogate pairs.
Michael Albinus [Sun, 1 Jan 2017 12:03:55 +0000 (13:03 +0100)]
Remove tramp-gw.el, which was synced from emacs-25 by accident
Michael Albinus [Sun, 1 Jan 2017 11:59:58 +0000 (12:59 +0100)]
; Fix typo
* src/gfilenotify.c:
Paul Eggert [Sun, 1 Jan 2017 10:33:29 +0000 (02:33 -0800)]
Do not use Gnulib’s m4/wint_t.m4.
* admin/merge-gnulib: Remove m4/wint_t.m4 when merging.
Fix typo so that warn-on-use.m4 is removed too.
* configure.ac (gt_TYPE_WINT_T): New macro, replacing Gnulib’s.
* m4/wint_t.m4: Remove.
Paul Eggert [Sun, 1 Jan 2017 10:04:35 +0000 (02:04 -0800)]
Merge from gnulib, continued
* m4/wint_t.m4: New file, copied from gnulib.
Paul Eggert [Sun, 1 Jan 2017 09:48:38 +0000 (01:48 -0800)]
Update copyright year to 2017 in master
Run admin/update-copyright in the master branch. This fixes files
that were not already fixed in the emacs-25 branch before it was
merged here.
Paul Eggert [Sun, 1 Jan 2017 09:37:30 +0000 (01:37 -0800)]
Remove test/automated detritus from merge
Paul Eggert [Sun, 1 Jan 2017 09:32:27 +0000 (01:32 -0800)]
Merge from gnulib
This incorporates:
2016-12-19 stdint: Fix WINT_MAX to match wint_t on mingw
2016-12-18 getopt: Fix link error for users of getopt() in <unistd.h>
2016-12-17 getlogin: Port to newer mingw
2016-12-17 stdint: Fix WINT_MAX to match wint_t on MSVC
2016-12-17 Avoid redefinition errors on MSVC
* lib/getopt.in.h, lib/stdint.in.h, lib/stdio.in.h, lib/unistd.in.h:
* m4/stdint.m4, m4/unistd_h.m4:
Copy from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
Plus, this commit updates the indenting on copyright notices to
match that of gnulib.
Paul Eggert [Sun, 1 Jan 2017 09:10:47 +0000 (01:10 -0800)]
Merge from origin/emacs-25
2e2a806 Fix copyright years by hand
5badc81 Update copyright year to 2017
Paul Eggert [Sun, 1 Jan 2017 09:05:03 +0000 (01:05 -0800)]
; Merge from origin/emacs-25
The following commit was skipped:
e092f08 Bump Emacs version to 25.1.91
Paul Eggert [Sun, 1 Jan 2017 09:05:02 +0000 (01:05 -0800)]
Merge from origin/emacs-25
665be69 ; Update ChangeLog.2 and AUTHORS files
# Conflicts:
# etc/AUTHORS
Paul Eggert [Sun, 1 Jan 2017 09:02:48 +0000 (01:02 -0800)]
; Merge from origin/emacs-25
The following commits were skipped:
e8f0d7d Backport: Remove an ambiguity from defvar's doc string. Fixe...
af1b102 * lisp/emacs-lisp/inline.el: Fix apply-conversion (bug#25280)
Paul Eggert [Sun, 1 Jan 2017 09:02:47 +0000 (01:02 -0800)]
Merge from origin/emacs-25
697167b ; Improve wording of previous change in variables.texi
d7973e8 Document 'default-toplevel-value' and 'set-default-toplevel-v...
8b71826 Don't modify minibuffer variables globally
5b5e036 Revert to pre-25.1 behavior in ffap
19994a1 * lisp/ffap.el: Fix obsolete comment referencing ffap-bug.
3ace730 Attempt to fix 64-bit AIX build
f69bd79 Clarify usage of 'ediff-cleanup-hook' (Bug#24675)
c04ac8a Document that variable binding order is unspecified
272554a * lisp/desktop.el (desktop-buffers-not-to-save): Doc fix.
08de101 Fix M-x hints on Mac port
86a297a Work around reporting a dpi change in apply_xft_settings
cf1f985 ; lisp/skeleton.el (skeleton-insert): Fix typo in last change
9e1209d Amend the version number of CC Mode 5.33 -> 5.32.99. Don't m...
88cdf14 Improve skeleton docstrings
Paul Eggert [Sun, 1 Jan 2017 09:02:47 +0000 (01:02 -0800)]
; Merge from origin/emacs-25
The following commit was skipped:
ce55382 ; Auto-commit of loaddefs file.
Paul Eggert [Sun, 1 Jan 2017 09:02:46 +0000 (01:02 -0800)]
Merge from origin/emacs-25
4179238 Improve documentation of 'w32-scroll-lock-modifier'
Paul Eggert [Sun, 1 Jan 2017 09:02:46 +0000 (01:02 -0800)]
; Merge from origin/emacs-25
The following commit was skipped:
dfc9f11 Merge branch 'emacs-25' of git.savannah.gnu.org:/srv/git/emac...
Paul Eggert [Sun, 1 Jan 2017 09:02:45 +0000 (01:02 -0800)]
Merge from origin/emacs-25
9adb101 Document 'describe-fontset'
229315c ; Add missing symbol quoting.
3d94931 Repair desktop restoration on text terminals
43022f9 Ignore forward-sexp-function in js-mode indentation code
b19fb49 Improve documentation of 'define-coding-system'
467768f Fix Bug#25162
6db78ae Fix a typo in define-abbrev-table
5f7d906 Bump makeinfo requirement from 4.7 to 4.13
442e2f6 Fixes related to select-enable-clipboard
e4ac450 Define struct predicate before acccesors
08decbd Doc fix for vc-git
5531e75 Further improve make-dist checking
953bf67 Improve previous make-dist change
129645a Make make-dist --snapshot do some sanity checks
# Conflicts:
# lisp/menu-bar.el
Alan Mackenzie [Sun, 1 Jan 2017 08:28:04 +0000 (08:28 +0000)]
Give eval-and-compile a correct edebug spec. Fixes bug #16184 properly.
* lisp/emacs-lisp/edebug.el (edebug_offset_indices): Revert abortive commit
from Thu Dec 29 09:22:36 2016 +0000 which didn't really fix the bug.
* lisp/emacs-lisp/byte-run.el (eval-and-compile): Change the edebug spec from
t to (&rest def-form).
Paul Eggert [Sun, 1 Jan 2017 04:01:41 +0000 (04:01 +0000)]
Fix copyright years by hand
These are dates that admin/update-copyright did not update, or
updated incorrectly.
Paul Eggert [Sun, 1 Jan 2017 03:14:01 +0000 (03:14 +0000)]
Update copyright year to 2017
Run admin/update-copyright.
Paul Eggert [Sat, 31 Dec 2016 21:10:38 +0000 (13:10 -0800)]
Clarify internal_catch etc.
The recent change to internal_catch and friends relied on some
confusion I introduced to the code in 2013. Attempt to fix
the confusion by clarifying the code instead. This saves an
instruction and a load dependency in the typical case.
* src/eval.c (internal_catch, internal_condition_case)
(internal_condition_case_1, internal_condition_case_2)
(internal_condition_case_n): Undo the previous change. Instead,
use use ‘c’ rather than ‘handlerlist’ in the typical case.
Also, use ‘eassert’ rather than ‘clobbered_eassert’ when possible.
Ken Brown [Sat, 31 Dec 2016 21:16:12 +0000 (16:16 -0500)]
Further improve filenotify-tests.el
* test/lisp/filenotify-tests.el
(file-notify--test-read-event): Adapt to file monitors of type
GFamFileMonitor, which occur on Cygwin.
(file-notify--test-monitor): Update doc string.
Paul Eggert [Sat, 31 Dec 2016 17:13:38 +0000 (09:13 -0800)]
* src/xdisp.c (string_from_display_spec): Simplify.
Alan Third [Sat, 31 Dec 2016 10:31:19 +0000 (10:31 +0000)]
Rework NS event handling (bug#25265)
* src/nsterm.m (unwind_apploopnr): Remove.
(ns_read_socket): Remove references to apploopnr. Make processing the
NS event loop conditional on being in the main thread.
(ns_select): Remove references to apploopnr. Remove all fd_handler
related stuff. Check if there are events waiting on the NS event
queue rather than running the event loop. Remove unused variables and
code.
(fd_handler): Remove.
(ns_term_init): Remove creation of fd_handler thread.
(hold_event, EmacsApp:sendEvent, EmacsView:mouseMoved,
EmacsView:windowDidExpose): Remove send_appdefined.
(ns_send_appdefined): Always check the event queue for
applicationDefined events rather than relying on send_appdefined var.
* src/nsterm.h: Remove reference to fd_handler method.
Philipp Stephani [Fri, 30 Dec 2016 17:00:54 +0000 (18:00 +0100)]
Checkdoc: use syntax functions instead of regex
In checkdoc.el, get rid of the error-prone regex to find definition
forms, and use existing syntax-based navigation functions instead.
This fixes a corner case with one-argument `defvar' forms.
* lisp/emacs-lisp/checkdoc.el (checkdoc--next-docstring): New function.
(checkdoc-next-docstring, checkdoc-defun): Use it.
* test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-tests--next-docstring):
Add unit test.
Eli Zaretskii [Sat, 31 Dec 2016 12:07:39 +0000 (14:07 +0200)]
Don't define NOMINMAX on MS-Windows
* src/callproc.c (NOMINMAX) [WINDOWSNT]: Don't define. This is no
longer needed with the current sources and MinGW headers, while
defining NOMINMAX causes an annoying compiler warning.
Chris Gregory [Sat, 31 Dec 2016 11:36:32 +0000 (13:36 +0200)]
Simplify code in eval.c that calls 'setjmp'
* src/eval.c (internal_catch, internal_condition_case)
(internal_condition_case_1, internal_condition_case_2)
(internal_condition_case_n): Factor out the common tail of the
functions.
Copyright-paperwork-exempt: yes
Chris Gregory [Sat, 31 Dec 2016 11:18:57 +0000 (13:18 +0200)]
Simplify code in 'string_from_display_spec'
* src/xdisp.c (string_from_display_spec): Eliminate a redundant
test before the loop.
Copyright-paperwork-exempt: yes
Eli Zaretskii [Sat, 31 Dec 2016 11:01:19 +0000 (13:01 +0200)]
Serialize random number generation on MS-Windows
* src/w32.c (rand_as183): New function.
(random): Use it instead of MS runtime's 'rand'. This avoids
producing separate and identical random series in each Lisp
thread.
(srandom): Modify to supply 3 seed values to 'rand_as183'.
Michael Albinus [Sat, 31 Dec 2016 09:40:04 +0000 (10:40 +0100)]
* src/gfilenotify.c (Fgfile_monitor_name): Return interned symbol.
Ken Raeburn [Fri, 30 Dec 2016 22:51:35 +0000 (17:51 -0500)]
Don't call xg_select for a NextStep build.
NextStep builds use glib but don't use xg_select.
* src/process.c (wait_reading_process_output): Don't call xg_select
for a NextStep build.
Ken Raeburn [Fri, 30 Dec 2016 22:41:26 +0000 (17:41 -0500)]
Increase the obarray size.
In a typical GNU/Linux/X11 build, we wind up with over 15k symbols by
the time we've started. The old obarray size ensured an average chain
length of 10 or more.
* src/lread.c (OBARRAY_SIZE): Increase to 15121.
Ken Raeburn [Fri, 30 Dec 2016 01:56:31 +0000 (20:56 -0500)]
Initialize thread support for Xlib.
* src/xterm.c (x_initialize) [THREADS_ENABLED]: Call XInitThreads
before doing anything else with X.
Paul Eggert [Fri, 30 Dec 2016 21:42:38 +0000 (13:42 -0800)]
Rename primary_thread to main_thread
This avoids the confusion of using two different phrases "main thread"
and "primary thread" internally to mean the same thing. See:
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg01142.html
* src/thread.c (main_thread): Rename from primary_thread,
since the new name no longer clashes with main_thread_id
and Emacs internals normally call this the "main thread".
(init_main_thread): Rename from init_primary_thread.
(main_thread_p): Rename from primary_thread_p.
All uses changed.
Paul Eggert [Fri, 30 Dec 2016 21:01:39 +0000 (13:01 -0800)]
Rename main_thread to main_thread_id and simplify
* src/emacs-module.c: Include syssignal.h, for main_thread_id.
[HAVE_PTHREAD]: Do not include pthread.h.
(main_thread): Remove. All uses replaced by main_thread_id,
or by dwMainThreadId on NT. Since the HAVE_PTHREAD code is now using
the main_thread_id established by sysdep.c, there is no need for a
separate copy of the main thread ID here.
(module_init): Remove. All uses removed.
* src/sysdep.c (main_thread_id) [HAVE_PTHREAD]:
Rename from main_thread. All uses changed. Now extern.
Michael Albinus [Fri, 30 Dec 2016 19:04:33 +0000 (20:04 +0100)]
* src/gfilenotify.c (Fgfile_monitor_name): Return a symbol.
Paul Eggert [Fri, 30 Dec 2016 17:45:46 +0000 (09:45 -0800)]
* src/sysdep.c (deliver_process_signal): Improve comment.
Alan Mackenzie [Fri, 30 Dec 2016 15:31:42 +0000 (15:31 +0000)]
CC Mode: Fix the fontification of a spuriously recognised enum member.
The "enum" was in an argument list, but triggered the fontification of a
following identifier in the function block as though it were in an enum
declaration.
* lisp/progmodes/cc-fonts.el (c-font-lock-enum-body): New function.
(c-basic-matchers-after): Replace the inline stanza for enum elements with a
call to c-font-lock-enum-body.
* lisp/progmodes/cc-langs.el (c-enum-clause-introduction-re): New language
variable.
Nicolas Petton [Fri, 30 Dec 2016 14:38:03 +0000 (15:38 +0100)]
Bump Emacs version to 25.1.91
* README:
* configure.ac:
* msdos/sed2v2.inp:
* nt/README.W32: Bump Emacs version.
* lisp/ldefs-boot.el: Update.
Nicolas Petton [Fri, 30 Dec 2016 14:37:44 +0000 (15:37 +0100)]
; Update ChangeLog.2 and AUTHORS files
Eli Zaretskii [Fri, 30 Dec 2016 09:36:07 +0000 (11:36 +0200)]
Attempt to fix crashes with threads in GTK builds
* src/xgselect.c (xg_select): Call pselect via thread_select, not
directly, to avoid running Lisp (via unblock_input) when more than
one thread could be running. (Bug#25247)
* src/process.c (wait_reading_process_output) [HAVE_GLIB]: Call
xg_select directly instead of through thread_select.
* src/xgselect.h (xg_select): Last 2 arguments are no longer
'const', for consistency with thread_select.
Arash Esbati [Fri, 30 Dec 2016 06:44:41 +0000 (07:44 +0100)]
Add entry for biblatex
* lisp/textmodes/reftex-vars.el (reftex-cite-format-builtin): Add
entry for biblatex macros.
Alan Mackenzie [Thu, 29 Dec 2016 20:52:02 +0000 (20:52 +0000)]
Backport: Remove an ambiguity from defvar's doc string. Fixes bug #25292.
The ambiguity was whether INITVALUE is evaluated when it's not going to be
used to set SYMBOL's value.
* src/eval.c (defvar): Rewrite a paragraph of the doc string.
(cherry picked from commit
8295e97f18490a535d1188a3daf0b0fd1bf4fa0d)
Tino Calancha [Fri, 30 Dec 2016 06:31:01 +0000 (15:31 +0900)]
ffap-string-at-point: Limit max length of active region
Prevents that 'ffap-guesser' waste time checking large strings
which are likely not valid candidates (Bug#25243).
* lisp/ffap.el (ffap-max-region-length): New variable.
(ffap-string-at-point): Use it.
* test/lisp/ffap-tests.el: New test suite.
(ffap-tests-25243): Add test for this bug.
Thien-Thi Nguyen [Fri, 30 Dec 2016 06:13:17 +0000 (07:13 +0100)]
last-chance: Also ignore NEWS files + typo fixes
* admin/last-chance.el: Fix typo in copyright notice.
(last-chance-uninteresting-regexps): Add entry to match NEWS files.
(last-chance-cleanup): Fix typo in docstring.
Mike Kupfer [Wed, 28 Dec 2016 23:46:19 +0000 (15:46 -0800)]
* mh-e.el (mh-fetch-x-image-url): Fix a docstring typo.
Alan Mackenzie [Thu, 29 Dec 2016 20:52:02 +0000 (20:52 +0000)]
Remove an ambiguity from defvar's doc string. Fixes bug #25292.
The ambiguity was whether INITVALUE is evaluated when it's not going to be
used to set SYMBOL's value.
* src/eval.c (defvar): Rewrite a paragraph of the doc string.
Michael Albinus [Thu, 29 Dec 2016 18:48:17 +0000 (19:48 +0100)]
Improve filenotify-tests.el
* src/inotify.c (Finotify_valid_p):
* src/kqueue.c (Fkqueue_valid_p):
* src/w32notify.c (Fw32notify_valid_p):
* src/gfilenotify.c (Fgfile_valid_p): Fix typo in docstring.
(Fgfile_monitor_name): New defun.
(syms_of_gfilenotify): Declare Sgfile_monitor_name.
* test/lisp/filenotify-tests.el (file-notify--test-read-event):
New defun, derived from `file-notify--test-read-event-timeout'.
Replace all calls of `read-event' by this.
(file-notify--test-timeout): Fix docstring.
(file-notify--test-monitor): New defun.
(file-notify--deftest-remote): Do not bind
`file-notify--test-read-event-timeout' anymore.
(file-notify-test00-availability): Print also monitor, if existent.
(file-notify--test-with-events): Add an additional
`file-notify--test-read-event' call, in order to get it work
after `file-notify-add-watch'. Remove special timeout for cygwin.
(file-notify-test02-events): Make a better check for cygwin.
(file-notify-test06-many-events): Improve event list for cygwin.
(file-notify-test08-watched-file-in-watched-dir): Add cygwin case.
Alan Mackenzie [Thu, 29 Dec 2016 15:34:36 +0000 (15:34 +0000)]
Partially correct fontification of "(b*3)", and the like, in C++ Mode
This problem is caused by the fundamental ambiguity in C++ between
argument declarations and initialisation clauses.
* lisp/progmodes/cc-fonts.el (c-font-lock-declarations): If we have an open
paren preceded by an arithmetic operator, we give this the context nil, not
'arglist.
* lisp/progmodes/cc-langs.el (c-arithmetic-operators, c-arithmetic-op-regexp):
New lang consts and vars.
Alan Mackenzie [Thu, 29 Dec 2016 09:22:36 +0000 (09:22 +0000)]
Initialize edebug-offset-indices to a cons, not nil. Fixes bug #16184.
This is because there are times when this variable is changed by setcar before
an atom is pushed onto it by debug-enter. This happens, for example, whilst
instrumenting c-font-lock-declarations in .../lisp/progmodes/cc-fonts.el.
* lisp/emacs-lisp/edebug.el (edebug-offset-indices): initialize to '(0).
Stefan Monnier [Tue, 27 Dec 2016 17:44:32 +0000 (12:44 -0500)]
* lisp/emacs-lisp/inline.el: Fix apply-conversion (bug#25280)
(inline--dont-quote): Quote the function with #' when passing it to `apply'.
Cherry picked from commit
e6161f648903d821865b9610b3b6aa0f82a5dcb7.
Paul Eggert [Tue, 27 Dec 2016 23:27:40 +0000 (15:27 -0800)]
; fix indenting
Problem reported by Chris Gregory in:
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00968.html
* src/keyboard.c (read_event_from_main_queue): Fix indenting.
Michael Albinus [Tue, 27 Dec 2016 19:06:27 +0000 (20:06 +0100)]
Release Tramp 2.3.1
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.3.1".
* lisp/net/tramp.el (tramp-eshell-directory-change): Add it to
`eshell-mode-hook' but `eshell-first-time-mode-hook'.
* lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p)
(tramp-compat-file-name-quote)
(tramp-compat-file-name-unquote): Embed them in `eval-and-compile'.
Paul Eggert [Tue, 27 Dec 2016 18:32:44 +0000 (10:32 -0800)]
Simplify prog1 implementation
Inspired by a suggestion from Chris Gregory in:
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00965.html
On my platform, this generates exactly the same machine insns.
* src/eval.c (prog_ignore): Rename from unwind_body, since
it’s more general than that. All callers changed.
(Fprog1): Simplify by using prog_ignore.
(Fwhile): Clarify by using prog_ignore.
Stefan Monnier [Tue, 27 Dec 2016 17:44:32 +0000 (12:44 -0500)]
* lisp/emacs-lisp/inline.el: Fix apply-conversion (bug#25280)
(inline--dont-quote): Quote the function with #' when passing it to `apply'.
Mark Oteiza [Tue, 27 Dec 2016 16:09:39 +0000 (11:09 -0500)]
Remove a use of lexical-let
* lisp/gnus/message.el (message-completion-function): Just use let,
since the file now uses lexical-binding.
Ken Brown [Mon, 26 Dec 2016 18:24:43 +0000 (13:24 -0500)]
Improve filenotify-tests.el on Cygwin (Bug #21804)
* test/lisp/filenotify-tests.el [CYGWIN]
(file-notify--test-read-event-timeout): Increase.
(file-notify--test-with-events): Add delay before executing body.
(file-notify-test02-events, file-notify-test04-file-validity):
Adjust expected results.
Eli Zaretskii [Tue, 27 Dec 2016 08:12:06 +0000 (10:12 +0200)]
Fix expand-file-name on DOS_NT systems when /: escaping is used
* src/fileio.c (Fexpand_file_name) [DOS_NT]: Don't expand "~" in
file names escaped by "/:". Don't recursively expand
default-directory escaped with "/:" which is not followed by a
drive spec. (Bug#25183)
Eli Zaretskii [Tue, 27 Dec 2016 07:10:30 +0000 (09:10 +0200)]
; Improve wording of previous change in variables.texi
* doc/lispref/variables.texi (Default Value): Improve wording of
last change.
Bake Timmons [Tue, 27 Dec 2016 06:39:02 +0000 (06:39 +0000)]
Fix `mail-sources' value of `(group)' in Gnus manual (bug#25275)
* doc/misc/gnus.texi (Mail Source Specifiers):
Replace wrong `mail-sources' value of `(group)' in Gnus manual with
the correct `((group))' value. (bug#25275) (tiny change)
Bake Timmons [Tue, 27 Dec 2016 06:38:41 +0000 (06:38 +0000)]
Fix bug in customizing `mail-sources' variable (bug#25274)
* lisp/gnus/mail-source.el (mail-sources): Use list instead of cons
for lone argument. (bug#25274) (tiny change)
Philipp Stephani [Wed, 23 Nov 2016 19:29:36 +0000 (20:29 +0100)]
Checkdoc: Don't require a space before an arg list
See Bug#24998.
* lisp/emacs-lisp/checkdoc.el (checkdoc-defun-regexp): Don't require a
space before a argument list.
* test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-tests--bug-24998):
Add unit test.
Eli Zaretskii [Mon, 26 Dec 2016 17:10:49 +0000 (19:10 +0200)]
Document 'default-toplevel-value' and 'set-default-toplevel-value'
* doc/lispref/variables.texi (Default Value): Document
'default-toplevel-value' and 'set-default-toplevel-value'.
Michihito Shigemura [Tue, 20 Dec 2016 12:12:35 +0000 (21:12 +0900)]
Add zshrc and zshenv detection to sh-mode (bug#25217)
* lisp/progmodes/sh-script.el (sh-mode): Add zsh string-match
Copyright-paperwork-exempt: yes
Paul Eggert [Sun, 25 Dec 2016 18:12:39 +0000 (10:12 -0800)]
Fix typo in lisp.h reordering patch
* src/lisp.h (XUNTAG) [!USE_LSB_TAG]: Remove duplicate defn.
Reported by Eli Zaretskii (Bug#25128#19).
Paul Eggert [Sun, 25 Dec 2016 18:02:27 +0000 (10:02 -0800)]
regex.h now includes sys/types.h
* src/dired.c, src/emacs.c, src/search.c, src/syntax.c, src/thread.h:
Do not include sys/types.h; no longer needed.
* src/regex.h: Include <sys/types.h>, as that's what Gnulib and
glibc regex.h does, and POSIX has blessed this since 2008.
Paul Eggert [Sun, 25 Dec 2016 17:17:02 +0000 (09:17 -0800)]
Reorder lisp.h to declare types before using them
This puts basic functions for types to be after the corresponding
type definitions. This is a more-common programming style in C,
and will make it easier to port Emacs to gcc
-fcheck-pointer-bounds, since the functions now have access to the
corresponding types' sizes. This patch does not change the code;
it just moves declarations and definitions and removes
no-longer-needed forward declarations (Bug#25128).
* src/buffer.c, src/data.c, src/image.c:
Include process.h, for PROCESSP.
* src/buffer.h (BUFFERP, CHECK_BUFFER, XBUFFER):
* src/process.h (PROCESSP, CHECK_PROCESS, XPROCESS):
* src/termhooks.h (TERMINALP, XTERMINAL):
* src/window.h (WINDOWP, CHECK_WINDOW, XWINDOW):
* src/thread.h (THREADP, CHECK_THREAD, XTHREAD, MUTEXP, CHECK_MUTEX)
(XMUTEX, CONDVARP, CHECK_CONDVAR, XCONDVAR):
Move here from lisp.h.
* src/intervals.h: Include buffer.h, for BUFFERP.
Include lisp.h, for Lisp_Object.
* src/lisp.h: Reorder declarations and definitions as described
above. Move thread includes to be later, so that they can use the
reordered definitions. Move some symbols to other headers (noted
elsewhere). Remove forward decls that are no longer needed.
* src/thread.h: Include systhread.h here, not in lisp.h,
since lisp.h itself does not need systhread.h.
Leo Liu [Sun, 25 Dec 2016 06:37:51 +0000 (14:37 +0800)]
Don't modify minibuffer variables globally
* lisp/files.el (cd): Use setq-local instead. (Bug#25260)
Dima Kogan [Tue, 20 Dec 2016 07:23:14 +0000 (23:23 -0800)]
diff-mode auto-refines only after a successful motion
Prior to this patch (if enabled) auto-refinement would kick in after all
hunk navigation commands, even if the motion failed. This would result
in a situation where the hunk navigation would signal an error and beep,
but yet still accomplish potentially useful work, by auto-refining.
This patch moves the auto-refinement code to only run when a motion was
successful
* lisp/vc/diff-mode.el (diff--internal-hunk-next,
diff--internal-hunk-prev): Removed auto-refinement-triggering code
* lisp/vc/diff-mode.el (diff--wrap-navigation): Added
auto-refinement-triggering code
Dima Kogan [Tue, 20 Dec 2016 07:25:28 +0000 (23:25 -0800)]
diff-mode is able to better handle file headers
This fixes a regression introduced in
http://git.savannah.gnu.org/gitweb/?p=emacs.git;a=commit;h=
2c8a7e50d24daf19ea7d86f1cfeaa98a41c56085
This bug was filed in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25105
Patches generated from a VCS such as git contain a patch message at the
start, and diff-mode is now once-again able to properly able to ignore
this message when issuing navigation commands around the message.
* lisp/vc/diff-mode.el (diff-beginning-of-file-and-junk): More
thoroughly ignore the header when looking for a beginning of file
diffs.
Paul Eggert [Sun, 25 Dec 2016 01:03:22 +0000 (17:03 -0800)]
Use libpng-config --ldflags, not --libs
Problem reported by James K. Lowden (Bug#25268).
* configure.ac (LIBPNG): Pass --ldflags, not --libs, to libpng-config.
Eli Zaretskii [Sat, 24 Dec 2016 18:12:06 +0000 (20:12 +0200)]
Revert to pre-25.1 behavior in ffap
* lisp/ffap.el (ffap-lax-url): Change the default to t, to produce
the same behavior as in Emacs 24.x. (Bug#25264)
Explain the trade-offs of customizing this in the doc string.
Noam Postavsky [Sat, 24 Dec 2016 15:35:30 +0000 (10:35 -0500)]
* lisp/ffap.el: Fix obsolete comment referencing ffap-bug.
Noam Postavsky [Sat, 24 Dec 2016 14:41:46 +0000 (09:41 -0500)]
Remove redundant `save-match-data' in whitespace.el
* lisp/whitespace.el (whitespace-cleanup, whitespace-cleanup-region):
(whitespace-report-region): Remove redundant `save-match-data' calls.
Noam Postavsky [Wed, 21 Dec 2016 04:02:48 +0000 (23:02 -0500)]
Fix whitespace eob cleanup
* lisp/whitespace.el (whitespace-empty-at-eob-regexp): Match any number
of empty lines at end of buffer.
* test/lisp/whitespace-tests.el (whitespace-cleanup-eob): New test.
(whitespace-tests--cleanup-string): New helper function for tests.
Hong Xu [Sat, 24 Dec 2016 12:35:12 +0000 (14:35 +0200)]
Fix timezone detection of parse-iso8601-time-string
* parse-time.el (parse-iso8601-time-string): Fix timezone
parsing. Add a doc string. (Bug#25086)
* editfns.c (Fdecode-time): Doc fix.
* emacs-mime.texi (time-date): Add an example for
parse-iso8601-time-string.
* parse-time-tests.el (parse-time-tests): Add tests for
parse-iso8601-time-string.
Paul Eggert [Sat, 24 Dec 2016 05:38:59 +0000 (21:38 -0800)]
Simplify exec_byte_code via moving decls etc.
* src/bytecode.c (exec_byte_code): Simplify, mostly by moving
initializers into decls, and by omitting some unnecessary changes
to ‘top’.
Paul Eggert [Sat, 24 Dec 2016 05:13:58 +0000 (21:13 -0800)]
Remove interpreter’s byte stack
This improves performance overall on my benchmark on x86-64,
since the interpreted program-counter resides in a machine
register rather than in RAM.
* etc/DEBUG, src/.gdbinit: Remove xbytecode GDB command, as there
is no longer a byte stack to decode.
* src/bytecode.c (struct byte_stack, byte_stack_list)
(relocate_byte_stack): Remove. All uses removed.
(FETCH): Simplify now that pc is now local (typically, in a
register) and no longer needs to be relocated.
(CHECK_RANGE): Remove. All uses now done inline, in a different way.
(BYTE_CODE_QUIT): Remove; now done by op_relative_branch.
(exec_byte_code): Allocate a copy of the function’s bytecode,
so that there is no problem if GC moves it.
* src/lisp.h (struct handler): Remove byte_stack member.
All uses removed.
* src/thread.c (unmark_threads): Remove. All uses removed.
* src/thread.h (struct thread_state): Remove m_byte_stack_list member.
All uses removed. m_stack_bottom is now the first non-Lisp field.
Paul Eggert [Sat, 24 Dec 2016 04:30:11 +0000 (20:30 -0800)]
BYTE_CODE_SAFE typo fix
* src/bytecode.c (FETCH): Depend on the value of BYTE_CODE_SAFE,
not on whether it is defined.
Paul Eggert [Sat, 24 Dec 2016 03:01:36 +0000 (19:01 -0800)]
BYTE_CODE_SAFE cleanups
* src/bytecode.c (BYTE_MAINTAIN_TOP): Remove; no longer needed.
(struct byte_stack) [BYTE_MAINTAIN_TOP]:
Remove unused members ‘top’ and ‘bottom’.
(exec_byte_code): Nest inside { } to avoid GCC warning about
jumping over declaration when compiled with -DBYTE_CODE_SAFE.
Thien-Thi Nguyen [Sat, 24 Dec 2016 02:43:37 +0000 (03:43 +0100)]
last-chance: new utility lib for dangling deterrence
* admin/last-chance.el: New file.
Paul Eggert [Sat, 24 Dec 2016 02:28:44 +0000 (18:28 -0800)]
Use max_align_t instead of void *
* src/thread.c (run_thread): Don’t assume void * is aligned enough.
Eli Zaretskii [Fri, 23 Dec 2016 20:26:25 +0000 (22:26 +0200)]
Attempt to fix 64-bit AIX build
* src/unexaix.c (make_hdr, copy_text_and_data, write_segment): Fix
type-casts that assumed 32-bit pointers. (Bug#25141)
Philipp Stephani [Sun, 18 Dec 2016 21:18:01 +0000 (22:18 +0100)]
Clarify usage of 'ediff-cleanup-hook' (Bug#24675)
* doc/misc/ediff.texi (Hooks): Clarify usage of 'ediff-cleanup-hook'
Philipp Stephani [Fri, 23 Dec 2016 12:14:55 +0000 (13:14 +0100)]
Document that variable binding order is unspecified
* doc/lispref/variables.texi (Local Variables):
* cl.texi (Modify Macros): Document that binding order in 'let' and
'cl-letf' is unspecified.
Eli Zaretskii [Fri, 23 Dec 2016 14:17:52 +0000 (16:17 +0200)]
Prevent infloops in redisplay due to truncate-lines and overlays
* src/xdisp.c (hscroll_window_tree): Avoid inflooping in
redisplay_window when a screen line ends in an overlay string with
a newline. (Bug#25246)